commonlibsse_ng\re\c/
Character.rs

1use core::ffi::c_void;
2
3use crate::re::Actor::{Actor, ActorVtbl};
4use crate::re::FormTypes::FormType;
5use crate::re::offsets_rtti::RTTI_Character;
6use crate::re::offsets_vtable::VTABLE_Character;
7use crate::rel::id::VariantID;
8
9#[repr(C)]
10#[derive(Debug)]
11pub struct Character {
12    pub __base: Actor,
13}
14const _: () = assert!(core::mem::size_of::<Character>() == 0x78);
15
16impl Character {
17    /// Address & offset of the runtime type information (RTTI) identifier.
18    pub const RTTI: VariantID = RTTI_Character;
19
20    /// Address & offset of the virtual function table.
21    ///
22    /// The number of tables is the same as the number of classes with inherited virtual functions.
23    pub const VTABLE: [VariantID; 10] = VTABLE_Character;
24
25    /// The `FormType` value for Character.
26    pub const FORM_TYPE: FormType = FormType::ActorCharacter;
27}
28
29pub struct CharacterVtbl {
30    pub __base: ActorVtbl,
31    pub Unk_128: extern "C" fn(this: *mut Character, c_void) -> c_void, // 0x128
32    /// - Character: `{ return 1; }`
33    pub Unk_129: extern "C" fn(this: *mut Character, c_void) -> c_void, // 0x129
34}
35const _: () = {
36    const VTABLE_SIZE: usize = core::mem::size_of::<CharacterVtbl>();
37    const EXPECTED_SIZE: usize = (0x129 + 1) * core::mem::size_of::<usize>();
38    // assert!(VTABLE_SIZE == EXPECTED_SIZE);
39};
40
41#[commonlibsse_ng_derive_internal::to_bitflags]
42#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
43#[repr(u32)]
44pub enum RecordFlag {
45    Deleted = 1 << 5,
46    StartsDead = 1 << 9,
47    Persistent = 1 << 10,
48    InitiallyDisabled = 1 << 11,
49    Ignored = 1 << 12,
50    NoAIAcquire = 1 << 25,
51    DontHavokSettle = 1 << 29,
52}